The Reactor An Object-Oriented Wrapper for Event-Driven Port Monitoring and Service Demultiplexing (Part 1 of 2)

نویسنده

  • Douglas C. Schmidt
چکیده

This is part one of the third article in a series that describes techniques for encapsulating existing operating system (OS) interprocess communication (IPC) services within objectoriented (OO) C++ wrappers. The first article explains the main principles and motivations for OO wrappers [1], which simplify the development of correct, concise, portable, and efficient applications. The second article describes an OO wrapper called IPC SAP [2] that encapsulates the BSD socket and System V TLI system call Application Programmatic Interfaces (APIs). IPC SAP enables application programs to access local and remote IPC protocol families such as TCP/IP via a type-secure, object-oriented interface. This third article presents an OO wrapper for the I/O port monitoring and timer-based event notification facilities provided by the select and poll system calls.1 Both select and poll enable applications to specify a time-out interval to wait for the occurrence of different types of input and output events on one or more I/O descriptors. select and poll detect when certain I/O or timer events occur and demultiplex these events to the appropriate application(s). As with many other OS APIs, the event demultiplexing interfaces are complicated, error-prone, non-portable, and not easily extensible. An extensible OO framework called the Reactorwas developed to overcome these limitations. The Reactor provides a set of higher-level programming abstractions that simplify the design and implementation of event-driven distributed applications. The Reactor also shields developers from many error-prone details in the existing event demultiplexing APIs and improves application portability between different OS variants. The Reactor is somewhat different than the IPC SAP class wrapper described in [2]. IPC SAP added a relatively “thin” OO veneer to the BSD socket and System V TLI APIs. On the other hand, the Reactor provides a signif-

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

An Object Behavioral Pattern for Demultiplexing and Dispatching Handles for Synchronous Events

The Reactor design pattern handles service requests that are delivered concurrently by multiple clients. This pattern simplifies event-driven applications by integrating the synchronous demultiplexing of events and the dispatching of their corresponding event handlers. In addition, the Reactor pattern also decouples the generic demultiplexing and dispatching code from the application-specific e...

متن کامل

The Design and Implementation of the Reactor An Object-Oriented Framework for Event Demultiplexing (Part 2 of 2)

BASE CLASS handle_input() handle_output() handle_exception() handle_timeout() handle_close() get_handle() A APPLICATION-DEFINED CONCRETE DERIVED CLASS A P P L IC A T IO N L E V E L C ++ L IB R A R Y L E V E L OPERATING SYSTEM LEVEL READ EVENT HANDLERS WRITE EVENT HANDLERS EXCEPTION EVENT HANDLERS REACTOR OBJECT TIMER QUEUE TIME

متن کامل

An Object Behavioral Pattern for Concurrent Event Demultiplexing and Dispatching

Support the demultiplexing and dispatching of multiple event handlers, which are triggered concurrently by multiple events. The Reactor pattern simplifies event-driven applications by integrating the demultiplexing of events and the dispatching of event handlers.

متن کامل

Using Design Patterns and Frameworks to Develop Object-Oriented Communication Systems

Factory 19 Tactical Patterns Proxy { \Provide a surrogate or placeholder for another object to control access to it" Strategy { \De ne a family of algorithms, encapsulate each one, and make them interchangeable" Adapter { \Convert the interface of a class into another interface client expects" Singleton { \Ensure a class only has one instance and provide a global point of access to it" State { ...

متن کامل

An Object Behavioral Pattern for Concurrent Event Demultiplexing and Event Handler Dispatching

To illustrate the Reactor pattern, consider the event-driven server for a distributed logging service shown in Figure 1. Client applications use this service to log information (such as error notifications, debugging traces, and status updates) in a distributed environment. In this service, logging records are sent to a central logging server. The logging server outputs the logging records to a...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 1993